return {
  event = "VeryLazy",
  'akinsho/bufferline.nvim',
  version = "*",
  dependencies = {
    'nvim-tree/nvim-web-devicons',
  },
  config = function()
    vim.opt.termguicolors = true

    local opts = { noremap = true, silent = true }
    local map = vim.api.nvim_set_keymap

    -- gt 切换到下一个，gT切换到上一个
    map("n", "gt", ":BufferLineCycleNext<CR>", opts)
    map("n", "gT", ":BufferLineCyclePrev<CR>", opts)

    -- 根据标题给出的字母提示操作，按下对应的就关闭对应的tab bufferline
    map("n", "<leader>bq", ":BufferLinePickClose<CR>", opts)

    local status, bufferline = pcall(require, "bufferline")
    if not status then
      vim.notify("Not found bufferline.")
      return
    end

    bufferline.setup({
      options = {
        -- 使用 cmp-nvim-lsp
        diagnostics = "nvim_lsp",
        -- 标题同时显示错误和警告 需要 lsp 中的支持
        diagnostics_indicator = function(count, level, diagnostics_dict, context)
          local s = " "
          for e, n in pairs(diagnostics_dict) do
            local sym = e == "error" and " "
                or (e == "warning" and " " or " ") -- 
            s = s .. sym .. n .. " "
          end
          return s
        end,
        -- 左侧让出 nvim-tree 的位置
        offsets = { {
          filetype = "NvimTree",
          text = "File Explorer",
          highlight = "Directory",
          text_align = "left"
        } },
        -- 动态显示关闭键
        hover = {
          enabled = true,
          delay = 200,
          reveal = { 'close' }
        },
      },
    })
  end
}
